<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('津贴拨付')" />
</head>
<body class="gray-bg">
<div>

     <div class="container-div">

        <div class="row">

            <!--登录信息-->
            <input name="userid" th:value="${session.userid}" type="hidden" id="userid">
            <input name="username" th:value="${session.username}" type="hidden" id="username">
            <input name="deptid" th:value="${session.deptid}" type="hidden" id="deptid">

            <div id="jinduModal" style="" class="modal fade bs-example-modal-lg" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" data-keyboard="false" data-backdrop="static">
                <div class="modal-dialog modal-md" style="width:300px;" id="modal-dialog-jisuan">
                    <div class="modal-content" >
                        <div class="modal-header">
                            <h4 class="modal-title" id="myModalLabel-jisuan"></h4>
                        </div>
                        <div class="modal-body"  id="myModalBody">
                            <div style="text-align: center">
                                <img src="../../../img/loading.webp" width="100" height="100">
                            </div>
                            <div style='font-size:20px;font-weight:bold;padding-top:10px;width:240px;text-align:center;'>
                                <span>正在计算单位津贴,请稍后...</span>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <div class="tabs-container" style="margin-top:20px;">
                <ul class="nav nav-tabs">
                    <li id="shoukuantab" class=""><a data-toggle="tab" href="#tab-2" aria-expanded="false">津贴收款</a>
                    </li>
                    <li class="active"><a data-toggle="tab" href="#tab-1" aria-expanded="true">津贴拨付</a>
                    </li>
                </ul>

                <div class="tab-content">

                    <!--津贴拨付-->
                    <div id="tab-1" class="tab-pane active">
                        <div class="panel-body" id="jintiebofu">

                            <div class="col-sm-12 search-collapse">
                                <form id="formId">
                                    <div class="select-list">
                                        <ul>
                                            <li>
                                                <label style="width:80px;">拨款批次&nbsp;&nbsp;</label>
                                                <input style="width: 150px !important;" type="text" name="picimingcheng" v-model="picimingcheng"/>
                                            </li>
                                            <li class="sousuo">
                                                <a class="btn btn-success btn-md" @click="bindJingfeiPiciList"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                                <a class="btn btn-warning btn-md-sm" @click="reset"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                                            </li>
                                        </ul>
                                    </div>
                                </form>
                            </div>

                            <div class="col-sm-12 select-table table-striped">

                                <div style="display: flex">
                                    <div class="btn-group-md" id="toolbar" role="group">
                                        <button class="btn btn-primary btn-md dim" @click="toAdd()">
                                            <i class="fa fa-download"></i> 新增
                                        </button>
                                    </div>
                                </div>

                                <table id="bootstrap-table" class="table-hover table-striped table-bordered table" style="text-align: center;">
                                    <thead>
                                    <tr style="font-weight: bold;">
                                        <td>序号</td>
                                        <td>拨款批次</td>
                                        <td>计发年月</td>
                                        <td>本批次拨款截止时间</td>
                                        <td>发放人数</td>
                                        <td>发放金额(元)</td>
                                        <td>操作</td>
                                    </tr>
                                    <thead>
                                    <tbody>
                                    <tr v-for="(jingfeipiciitem,index) in jingfeipicilist"  v-if="jingfeipicilist.length > 0">
                                        <td style="vertical-align: middle; text-align: center;" v-text="index+1"></td>
                                        <td style="vertical-align: middle; text-align: center;" v-text="jingfeipiciitem.picimingcheng"></td>
                                        <!--<td style="vertical-align: middle; text-align: center;" v-text="jingfeipiciitem.kaishinianyue"></td>
                                        <td style="vertical-align: middle; text-align: center;" v-text="jingfeipiciitem.jieshunianyue"></td>-->
                                        <td style="vertical-align: middle; text-align: center;">
                                            <span style="display: block" v-for="month in jingfeipiciitem.monthlist" v-text="month.nianyue"></span>
                                        </td>
                                        <td style="vertical-align: middle; text-align: center;" v-text="jingfeipiciitem.jiezhishijian"></td>
                                        <td style="vertical-align: middle; text-align: center;" v-text="jingfeipiciitem.shifarenshu"></td>
                                        <!--<td style="vertical-align: middle; text-align: center;" v-text="jingfeipiciitem.tingfarenshu"></td>-->
                                        <td style="vertical-align: middle; text-align: center;" v-text="jingfeipiciitem.shifajine"></td>
                                        <!--<td style="vertical-align: middle; text-align: center;color:green" v-if="jingfeipiciitem.isdangqianpici=='1'">是</td>
                                        <td style="vertical-align: middle; text-align: center;color:red" v-if="jingfeipiciitem.isdangqianpici=='0'">否</td>-->
                                        <td style="vertical-align: middle; text-align: center;" v-text="">
                                            <button v-if="jingfeipiciitem.isfafang==0" class="btn btn-md btn-success" @click="toDanweiqueren(jingfeipiciitem)">单位确认情况</button>
                                            <button v-if="deptid=='000'&&jingfeipiciitem.isfafang==0" class="btn btn-md btn-warning" @click="toJisuan(jingfeipiciitem)">核算</button>
                                            <button v-else-if="deptid!='000'&&jingfeipiciitem.isfafang==0" class="btn btn-md btn-warning" @click="toDeptJisuan(jingfeipiciitem)">核算</button>
                                            <button class="btn btn-md btn-primary" v-if="jingfeipiciitem.isfafang==0&&jingfeipiciitem.isjisuan==1" @click="toFafangJingfei(jingfeipiciitem)">发放</button>
                                            <button class="btn btn-md btn-success" @click="toJingfeiPiciDetail(jingfeipiciitem)">查看</button>
                                            <!--<button class="btn btn-md btn-info btn-rounded" @click="Export(jingfeipiciitem)">导出拨款表</button>-->
                                            <button v-if="jingfeipiciitem.isfafang==0&&jingfeipiciitem.isjisuan==0" class="btn btn-md btn-danger" @click="Delete(jingfeipiciitem)">删除</button>
                                        </td>
                                    </tr>
                                    <tr v-if="jingfeipicilist.length == 0">
                                        <td style="text-align: center; vertical-align: middle" colspan="7">查无数据</td>
                                    </tr>
                                    </tbody>
                                </table>

                                <!-- 编辑经费批次信息 -->
                                <div th:replace="system/jintieguanli/modal_edit_jingfeipici::jingfeipici_edit"></div>
                                <!-- 发放信息 -->
                                <div th:replace="system/jintieguanli/modal_fafang::fafang"></div>

                            </div>

                        </div>
                    </div>

                    <!--津贴收款-->
                    <div id="tab-2" class="tab-pane">
                        <div class="panel-body" id="jintieshoukuan">

                            <div class="col-sm-12 search-collapse">
                                <form id="formId">
                                    <div class="select-list">
                                        <ul>
                                            <li>
                                                <label style="width:80px;">拨款批次&nbsp;&nbsp;</label>
                                                <input style="width:150px !important;" type="text" name="picimingcheng" v-model="piciname"/>
                                            </li>
                                            <li class="sousuo">
                                                <a class="btn btn-success btn-md" @click="bindJingfeiDeptList"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                                <a class="btn btn-warning btn-md" @click="Reset"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                                            </li>
                                        </ul>
                                    </div>
                                </form>
                            </div>

                            <div class="col-sm-12 select-table table-striped">
                                <table id="bootstrap-table" class="table-bordered table-hover table-striped table" style="text-align: center;">
                                    <thead>
                                    <tr style="font-weight: bold;">
                                        <td>序号</td>
                                        <td>拨款批次</td>
                                        <td>实发人数</td>
                                        <td>实发金额(元)</td>
                                        <td>收款状态</td>
                                        <td>上级单位拨款时间</td>
                                        <td>收款时间</td>
                                        <td>操作</td>
                                    </tr>
                                    <thead>
                                    <tbody>
                                    <tr v-for="(jingfeideptitem,index) in jingfeideptlist"  v-if="jingfeideptlist.length > 0">
                                        <td style="vertical-align: middle; text-align: center;" v-text="index+1"></td>
                                        <td style="vertical-align: middle; text-align: center;" v-text="jingfeideptitem.name"></td>
                                        <td style="vertical-align: middle; text-align: center;" v-text="jingfeideptitem.fafangrenshu"></td>
                                        <td style="vertical-align: middle; text-align: center;" v-text="jingfeideptitem.fafangjine"></td>
                                        <td style="vertical-align: middle; text-align: center;" :class="jingfeideptitem.isshoukuan==1?'green':'red'"  v-text="jingfeideptitem.isshoukuan==1?'已收款':'未收款'"></td>
                                        <td style="vertical-align: middle; text-align: center;" v-text="jingfeideptitem.shangjidanweifafangshijian">
                                        <td style="vertical-align: middle; text-align: center;" v-text="jingfeideptitem.shoukuanshijian">
                                        <td style="vertical-align: middle; text-align: center;" v-text="">
                                            <button v-if="jingfeideptitem.isshoukuan==0&&jingfeideptitem.isshangjifafang==1" class="btn btn-md btn-primary" @click="QuerenShoukuan(jingfeideptitem)">确认收款</button>
                                            <button class="btn btn-md btn-success" @click="toXiangqing(jingfeideptitem)">详情</button>
                                        </td>
                                    </tr>
                                    <tr v-if="jingfeideptlist.length == 0">
                                        <td style="text-align: center; vertical-align: middle" colspan="8">查无数据</td>
                                    </tr>
                                    </tbody>
                                </table>

                                <div th:replace="system/jintieguanli/modal_shoukuanxiangqing::shoukuanxiangqing"></div>

                            </div>

                        </div>
                    </div>

                </div>

            </div>

        </div>

    </div>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: WdatePicker" />
<link th:href="@{/ajax/libs/bootstrap-select/bootstrap-select.min.css?v=1.13.18}" rel="stylesheet"/>
<script th:src="@{/ajax/libs/bootstrap-select/bootstrap-select.min.js?v=1.13.18}"></script>
<script th:src="@{/js/system/jintieguanli/jintiebofu.js?v=6.0}"></script>
<script th:src="@{/js/system/jintieguanli/jintieshoukuan.js?v=1.0}"></script>
</body>
</html>

<style>
    .red{
        color: red;
    }
    .green{
        color: green;
    }
</style>